// 创建vue对象
var vm = new Vue({
    el: "#addBook",
    data(){
        return{
            v_bookName: null,
            v_bookCounts: null,
            v_detail: null
        }
    },
    methods: {
        addBooks(){
            // 发起请求
            axios.post("/books/add", {
                bookName: this.v_bookName,
                bookCounts: this.v_bookCounts,
                detail: this.v_detail
            })
            .then(resp => {
                window.location.href="/books/allBook.html"
            })
            .catch(error => (console.log(error)))
        }
    }
});